package pers.vic.dubbo.consumer.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.SessionRepository;
import pers.vic.dubbo.common.tool.SpringSessionUtil;

/**
 * 描述:
 * @author Vic.xu
 * @date 2022-01-25 10:54
 */
@Configuration
public class CommonConfig {

    @Bean
    @ConditionalOnMissingBean
    public SpringSessionUtil springSessionUtil(SessionRepository<?> sessionRepository){
        return new SpringSessionUtil(sessionRepository);
    }
}
